import {
  BarsOutlined,
  BugOutlined,
  CalculatorOutlined,
  LaptopOutlined,
  LineChartOutlined,
  RiseOutlined,
  BarChartOutlined,
  RadarChartOutlined,
  SlidersOutlined,
  AndroidOutlined,
  SettingOutlined,
  FontColorsOutlined,
  FundOutlined,
} from '@ant-design/icons';
import { RouteKey, RoutePath } from '../constants/router';
import { FCRouteObject } from '../fc-router-dom/fc-route';
import GlobalErrorBoundary from '@/components/boundary/global-error-boundary';
import Login from '@/pages/login';
import Platform from '@/pages/platform';
// import QuotationCopy from '@/pages/quotationCopy';

// export const fcRoutes: FCRouteObject[] = [
//   {
//     key: RouteKey.Home,
//     path: RoutePath[RouteKey.Home],
//     Component: Platform,
//     ErrorBoundary: GlobalErrorBoundary,
//     children: [
//       {
//         key: RouteKey.Release,
//         path: RoutePath[RouteKey.Release],
//         menu: { name: '行情', icon: <LineChartOutlined /> },
//         children: [
//           {
//             key: RouteKey.RDetail,
//             path: RoutePath[RouteKey.RDetail],
//           },
//         ],
//         lazy: async () => {
//           const { default: Component } = await import('@/pages/release');

//           return { Component };
//         },
//       },
//       {
//         key: RouteKey.Quotation,
//         path: RoutePath[RouteKey.Quotation],
//         // Component: Quotation,
//         menu: { name: '选股', icon: <SlidersOutlined /> },
//         lazy: async () => {
//           const { default: Component } = await import('@/pages/quotation');

//           return { Component };
//         },
//       },
//       {
//         key: RouteKey.QuotationCopy,
//         path: RoutePath[RouteKey.QuotationCopy],
//         Component: QuotationCopy,
//         menu: { name: '行情分析-重构', icon: <LineChartOutlined /> },
//         // lazy: async () => {
//         //   const { default: Component } = await import('@/pages/quotationCopy');

//         //   console.log(Component);

//         //   return { Component };
//         // },
//       },
//       {
//         key: RouteKey.Monitor,
//         path: RoutePath[RouteKey.Monitor],
//         menu: { name: '监控中', icon: <LaptopOutlined /> },
//         lazy: async () => {
//           const { default: Component } = await import('@/pages/monitor');

//           return { Component };
//         },
//       },
//       {
//         key: RouteKey.Trade,
//         path: RoutePath[RouteKey.Trade],
//         menu: { name: '交易记录', icon: <BarsOutlined /> },
//         lazy: async () => {
//           const { default: Component } = await import('@/pages/trade');

//           return { Component };
//         },
//       },
//       {
//         key: RouteKey.Debug,
//         path: RoutePath[RouteKey.Debug],
//         menu: { name: '调试', icon: <CalculatorOutlined /> },
//         lazy: async () => {
//           const { default: Component } = await import('@/pages/debug');

//           return { Component };
//         },
//       },
//       {
//         key: RouteKey.Crawler,
//         path: RoutePath[RouteKey.Crawler],
//         menu: { name: '爬虫', icon: <BugOutlined /> },
//         lazy: async () => {
//           const { default: Component } = await import('@/pages/crawler');

//           return { Component };
//         },
//       },
//       {
//         key: RouteKey.Selection,
//         path: RoutePath[RouteKey.Selection],
//         menu: { name: '选股器', icon: <RiseOutlined /> },
//         lazy: async () => {
//           const { default: Component } = await import('@/pages/selection');

//           return { Component };
//         },
//       },
//     ],
//   },
//   {
//     key: RouteKey.Login,
//     path: RoutePath[RouteKey.Login],
//     ErrorBoundary: GlobalErrorBoundary,
//     Component: Login,
//   },
//   {
//     key: RouteKey.TriggerRecord,
//     path: RoutePath[RouteKey.TriggerRecord],
//     // menu: { name: '触发记录', icon: <RiseOutlined /> },
//     lazy: async () => {
//       const { default: Component } = await import('@/pages/trigger-record');

//       return { Component };
//     },
//   },
// ];

export const fcRoutes: FCRouteObject[] = [
  {
    key: RouteKey.Home,
    path: RoutePath[RouteKey.Home],
    Component: Platform,
    ErrorBoundary: GlobalErrorBoundary,
    children: [
      {
        key: RouteKey.Dashboard,
        path: RoutePath[RouteKey.Dashboard],
        menu: { name: '看盘', icon: <LaptopOutlined /> },
        lazy: async () => {
          const { default: Component } = await import('@/pages/dashboard');

          return { Component };
        },
      },
      {
        key: RouteKey.QuotationNew,
        path: RoutePath[RouteKey.QuotationNew],
        menu: { name: '行情', icon: <BarChartOutlined /> },
        lazy: async () => {
          const { default: Component } = await import('@/pages/quotationNew');

          return { Component };
        },
      },
      {
        key: RouteKey.Stocks,
        path: RoutePath[RouteKey.Stocks],
        menu: { name: '监控池', icon: <BarsOutlined /> },
        lazy: async () => {
          const { default: Component } = await import('@/pages/stocks');

          return { Component };
        },
      },
      {
        key: RouteKey.Setting,
        path: RoutePath[RouteKey.Setting],
        menu: { name: '模式设置', icon: <SettingOutlined /> },
        lazy: async () => {
          const { default: Component } = await import('@/pages/setting');
          return { Component };
        },
      },
      {
        key: RouteKey.Bankuai,
        path: RoutePath[RouteKey.Bankuai],
        menu: { name: '预期设置', icon: <RadarChartOutlined /> },
        lazy: async () => {
          const { default: Component } = await import('@/pages/bankuai');
          return { Component };
        },
      },
      // {
      //   key: RouteKey.Monitor,
      //   path: RoutePath[RouteKey.Monitor],
      //   menu: { name: '实时情绪', icon: <BarChartOutlined/> },
      //   lazy: async () => {
      //     const { default: Component } = await import('@/pages/monitor');

      //     return { Component };
      //   },
      // },
      {
        key: RouteKey.Alerts,
        path: RoutePath[RouteKey.Alerts],
        menu: { name: 'AI播报', icon: <AndroidOutlined /> },
        lazy: async () => {
          const { default: Component } = await import('@/pages/alerts');
          return { Component };
        },
      },
      {
        key: RouteKey.Statics,
        path: RoutePath[RouteKey.Statics],
        menu: { name: '收益预测', icon: <FundOutlined /> },
        lazy: async () => {
          const { default: Component } = await import('@/pages/statics');

          return { Component };
        },
      },
    ],
  },
  {
    key: RouteKey.Login,
    path: RoutePath[RouteKey.Login],
    ErrorBoundary: GlobalErrorBoundary,
    Component: Login,
  },
];
